home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-15 | 17.1 KB | 511 lines | [TEXT/MPS ] |
- /* ------------------------------------------------------------------------------
- FILENAME
- NewAPIResources.r
-
- DESCRIPTION
- This module contains the LaserWriter SC constants, types, and resources that
- are specific to supporting the New (QuickDraw GX) API.
-
- Note: all resources should be designated to load into the system heap.
-
- COPYRIGHT
- Copyright Apple Computer, Inc. 1988-1996
- All rights reserved.
-
- MODIFICATION HISTORY
- 6/14/96 - cn - Updated to support Universal Interfaces 2.1.
-
- -------------------------------------------------------------------------------- */
-
- // System 7.0 Compatible
- #define SystemSevenOrLater 1
-
- // Include System Resource Definitions
- #include "Types.r"
- #include "SysTypes.r"
-
- // Include the LaserWriter SC driver constants that are used in the resources
- #include "LaserSCResources.h"
-
- // Include the public QuickDraw GX printing files
- #include "GXPrintingResTypes.r"
-
-
- /*********************************************************************************
- * RESOURCES *
- *********************************************************************************/
-
-
- /*************************** Universal Imaging Message Override Resource **************************/
- // This overrideType resource tells the Printing Manager which new Universal Imaging
- // Messages the driver overrides.
-
- resource gxOverrideType (gxDriverUniversalOverrideID, sysheap)
- {
- {
- gxInitialize, kNewAPISegmentID, kFirstMsgJumpTableOffset,
- gxShutDown, kNewAPISegmentID, kFirstMsgJumpTableOffset + 4,
- gxSetupPageImageData,kNewAPISegmentID, kFirstMsgJumpTableOffset + 8,
- gxSetUpImageData, kNewAPISegmentID, kFirstMsgJumpTableOffset + 12,
- gxOpenConnection, kNewAPISegmentID, kFirstMsgJumpTableOffset + 16,
- gxCloseConnection, kNewAPISegmentID, kFirstMsgJumpTableOffset + 20,
- gxStartSendPage, kNewAPISegmentID, kFirstMsgJumpTableOffset + 24,
- gxFinishSendPage, kNewAPISegmentID, kFirstMsgJumpTableOffset + 28,
- gxDefaultPrinter, kNewAPISegmentID, kFirstMsgJumpTableOffset + 32,
- gxWriteData, kNewAPISegmentID, kFirstMsgJumpTableOffset + 36,
- gxCheckStatus, kNewAPISegmentID, kFirstMsgJumpTableOffset + 40,
- gxGetDeviceStatus, kNewAPISegmentID, kFirstMsgJumpTableOffset + 44,
- gxCreateImageFile, kNewAPISegmentID, kFirstMsgJumpTableOffset + 48,
- gxFetchTaggedData, kNewAPISegmentID, kFirstMsgJumpTableOffset + 52,
- gxDoesPaperFit, kNewAPISegmentID, kFirstMsgJumpTableOffset + 60
- };
- };
-
-
- /*************************** Raster Imaging Message Override Resource **************************/
- // This overrideType resource tells the Printing Manager which Raster Imaging Messages the driver
- // overrides.
-
- resource gxOverrideType (gxDriverImagingOverrideID, sysheap)
- {
- {
- gxRasterDataIn, kNewAPISegmentID, kFirstMsgJumpTableOffset + 56
- };
- };
-
-
- /*************************** Type of Imaging System Supported by the Driver **************************/
- // This imagingSystemResType resource tells the Printing Manager the type of imaging system this
- // driver uses.
-
- resource gxImagingSystemSelectorType (gxImagingSystemSelectorID, sysheap)
- {
- gxRasterPrinterType // LaserWriter SC uses the raster imaging system
- };
-
-
- /*************************** Customizing Behavior of Raster Imaging Messages ***************************/
- // For most raster devices, the driver should include a resource of type, rasterPrefsType. This
- // resource allows the driver to specify the imaging options and format page scaling. Since
- // the Printing Manager default rasterPrefsType resource is defined for a 1 bit, 300 dpi device,
- // the LaserWriter SC driver uses this default.
-
-
- /*************************** I/O Related Resources ***************************/
-
- // This universalIOPrefsType resource controls the behavior of the standard buffering and IO
- // within the Universal Driver.
-
- resource gxUniversalIOPrefsType (gxUniversalIOPrefsID, sysheap)
- {
- standardIO,
- 0, // Universal Driver will not allocate any buffers
- 0, // size of the buffers allocated (N/A)
- 10, // number of I/O request blocks to allocate for the Universal Driver's I/O
- 1200, // 1200 tick timeout for open/close
- 1200, // 1200 tick timeout for reading and writing
- };
-
-
- /*************************** Status Dialog Related Resources ***************************/
- // The 'stat' resources provide the Printing Manager the status messages that need to be displayed at
- // any given time during the printing process. The driver forces statuses to be displayed by calling
- // either ReportStatus or AlertTheUser, depending upon whether the user needs to make some decision
- // about the printing process (e.g. paper tray not properly loaded. Note that though the statID field
- // of the 'stat' resource is for the clients use (us), PrinterShare requires that any 'stat' list
- // entry that has the same status type (e.g. informationalStatus) must have a unique statID. The reason
- // is that PrinterShare uses the (status type, statID) pair in comparisons to see if the status has
- // changed.
-
- resource 'stat' (kTransmissionStatID, sysheap) // Page transmission 'stat' - informational messages only
- {
- kDrvrCreatorType,
- {
- informationalStatus, 1, kNoAlertCoolID, "Waiting for the next sheet of paper…";
- informationalStatus, 2, kNoAlertCoolID, "Sending part of the page…";
- informationalStatus, 3, kNoAlertCoolID, "Preparing part of the page…";
- informationalStatus, 4, kNoAlertCoolID, "The printer is out of paper.";
- informationalStatus, 5, kNoAlertCoolID, "The printer has a paper jam.";
- informationalStatus, 6, kNoAlertCoolID, "The paper tray is improperly loaded.";
- userAlert, 7, kPrinterDoorOpenCoolID, "The printer door is open. Please close it.";
- informationalStatus, 8, kNoAlertCoolID, "The printer door is open. Please close it."; // Non-alert instance of the status
- informationalStatus, 9, kNoAlertCoolID, "A print test is in progress. Please wait…";
- informationalStatus, 10, kNoAlertCoolID, "The printer fixing unit is being heated. Please wait…";
- userAlert, 11, kBadTonerCartridgeCoolID, "The toner cartridge is improperly loaded.";
- informationalStatus, 12, kNoAlertCoolID, "The toner cartridge is improperly loaded."; // Non-alert instance of the status
- pageTransmission, 13, kNoAlertCoolID, "Printing the page.";
- userAlert, 14, kCantFindPrinterCoolID, "Trying to locate the printer…";
- openConnectionStatus, 15, kNoAlertCoolID, "Opening a connection to the printer…";
- }
- };
-
- resource 'stat' (kEngineStatusStatID, sysheap) // Printer engine status 'stat' - fatal errors
- {
- kDrvrCreatorType,
- {
- userAlert, 1, kLaserInitFailureCoolID, "Laser Printer engine initialization failed.";
- userAlert, 2, kDRamFailureCoolID, "Dynamic Ram test failure.";
- userAlert, 3, kBadPrintFixCoolID, "The printer fixing assembly has malfunctioned.";
- userAlert, 4, kBadLaserCoolID, "The printer laser has malfunctioned.";
- userAlert, 5, kBadPolyMotorCoolID, "The printer polygon motor has malfunctioned.";
- userAlert, 6, kBadSerialCoolID, "The printer has a serial communication malfunction.";
- userAlert, 7, kGenericBadHdwareCoolID, "The printer has a hardware malfunction.";
- userAlert, 8, kBadVersionAlertID, "Printer driver requires QuickDraw™ GX version 1.1 or later.";
- }
- };
-
-
-
- // Following are the gxPrintingAlertType alert definitions which are used to notify the user of FATAL printing errors.
-
- // This is our "this driver requires QDGX 1.1" alert.
-
- resource gxPrintingAlertType (kBadVersionAlertID, sysheap)
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The “LaserWriterIISC GX” printer driver "
- "cannot be used because it requires "
- "QuickDraw™ GX version 1.1 or later.", // text string
- "Cancel", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Driver Version Error"
- };
-
-
- // ...and this is what we use if we're running from the Chooser instead of the Finder.
-
- resource 'dctb' (kBadVersionDLOG, sysheap) {
- {}
- };
-
- resource 'ALRT' (kBadVersionDLOG, sysheap) {
- {40, 40, 162, 392},
- kBadVersionDLOG,
- {
- OK, visible, sound1,
- OK, visible, sound1,
- OK, visible, sound1,
- OK, visible, sound1
- },
- alertPositionParentWindow
- };
-
- resource 'DITL' (kBadVersionDLOG, sysheap) {
- {
- {92, 281, 112, 339},
- Button {
- enabled,
- "OK"
- },
- {8, 80, 74, 345},
- StaticText {
- disabled,
- "The printer driver “^0” cannot be used "
- "because it requires QuickDraw™ GX version "
- "1.1 or later."
- }
- }
- };
-
-
- resource gxPrintingAlertType (kLaserInitFailureCoolID, sysheap) // Laser Printer initialization failed
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because the printer !0 failed to initialize.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
-
- resource gxPrintingAlertType (kDRamFailureCoolID, sysheap) // Dynamic Ram test failure
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because the printer !0 experienced a dynamic RAM failure.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
-
- resource gxPrintingAlertType (kBadPrintFixCoolID, sysheap) // printer fixing assembly bad
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because the fixing assembly in the printer !0 has malfunctioned.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- resource gxPrintingAlertType (kBadLaserCoolID, sysheap) // laser bad
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because the laser in the printer !0 has malfunctioned.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- resource gxPrintingAlertType (kBadPolyMotorCoolID, sysheap) // polygon motor bad
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because the polygon motor in the printer !0 has malfunctioned.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- resource gxPrintingAlertType (kBadSerialCoolID, sysheap) // serial communication bad
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because a serial communication malfunction has occurred in the printer !0.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- resource gxPrintingAlertType (kGenericBadHdwareCoolID, sysheap) // unidentified hardware malfunction
- {
- printingStatus, // version
- stopIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // haven't got a cancel
- "The document !1 failed to print, because the printer !0 experienced an unknown hardware malfunction.", // text string
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- // Following are the gxPrintingAlertType alert definitions which are used to notify the user of NON-FATAL printing errors.
-
- resource gxPrintingAlertType (kPrinterDoorOpenCoolID, sysHeap) // The printer's door is open so we can't print
- {
- printingStatus, // version
- cautionIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- cancelTitle2, // second button is cancel
- "The printer door on the printer !0 is open. To " // text string
- "continue printing !1, please close the door and " // text string
- "click Continue. If you wish to cancel printing, " // text string
- "please click Cancel Printing.", // text string
- "Continue", // action label
- "Cancel Printing", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- resource gxPrintingAlertType (kBadTonerCartridgeCoolID, sysHeap) // The printer's toner cartridge is not inserted properly
- {
- printingStatus, // version
- cautionIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- cancelTitle2, // second button is cancel
- "The toner cartridge in the printer !0 is improperly " //
- "loaded. To continue printing !1, please re-install " //
- "the cartridge properly and click Continue. "
- "If you wish to cancel printing, " // text string
- "please click Cancel Printing.", // text string
- "Continue", // action label
- "Cancel Printing", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Failure"
- };
-
- resource gxPrintingAlertType (kCantFindPrinterCoolID, sysHeap) // The printer can't be found on the SCSI bus
- {
- printingStatus, // version
- cautionIcon, // icon id
- defaultSystemSize,
- defaultAction, // the default label
- noCancelTitle, // no cancel
- "The document !1 cannot be printed, because the printer "
- "!0 cannot be found. To continue printing, please make "
- "sure the printer is "
- "properly connected and turned on. If you wish "
- "to cancel printing, please click Cancel Printing.",
- "Cancel Printing", // action label
- "", // button label 2
- "", // button label 3
- " ", // font name
- "Printer Not Found"
- };
-
-
- /*************************** Paper Type Definitions for the New Printing Architecture **************************/
- // These paper type definitions represent the new settings for the LaserWriter SC's paper
- // sizes.
-
- resource 'ptyp' (kNewPaperTypesID + 1, sysheap) // US Letter
- {
- "US Letter",
-
- // page rectangle
- 0x00000000, // 8.0 x 10.583
- 0x00000000,
- 0x02400000,
- 0x02F9F9B8,
-
- // paper rectangle
- 0xFFEE0000, // 8.5 x 11.0
- 0xFFF0FCDC,
- 0x02520000,
- 0x0308FCDC,
-
- usLetterBase,
- kDrvrCreatorType,
-
- inch,
- newStylePaperType,
- isDefaultPaperType,
- {}
- };
-
- resource 'ptyp' (kNewPaperTypesID + 2, sysheap) // US Legal
- {
- "US Legal",
-
- // page rectangle
- 0x00000000, // 6.67 x 12.5
- 0x00000000,
- 0x01E03D68,
- 0x03840000,
-
- // paper rectangle
- 0xFFBE1EB4, // 8.5 x 14.0
- 0xFFCA0000,
- 0x02221EB4,
- 0x03BA0000,
-
- usLegalBase,
- kDrvrCreatorType,
-
- inch,
- newStylePaperType,
- notDefaultPaperType,
- {}
- };
-
- resource 'ptyp' (kNewPaperTypesID + 3, sysheap) // A4 Letter
- {
- "A4 Letter",
-
- // page rectangle
- 0x00000000, // 8.0 x 11.25
- 0x00000000,
- 0x02400000,
- 0x032A0000,
-
- // paper rectangle
- 0xFFF70000, // 8.25 x 11.6667
- 0xFFF0FFAC,
- 0x02490000,
- 0x03390054,
-
- a4LetterBase,
- kDrvrCreatorType,
-
- inch,
- newStylePaperType,
- notDefaultPaperType,
- {}
- };
-
- resource 'ptyp' (kNewPaperTypesID + 4, sysheap) // B5 Letter
- {
- "B5 Letter",
-
- // page rectangle
- 0x00000000, // 6.6667 x 9.4167
- 0x00000000,
- 0x01DFC290,
- 0X02C251EC,
-
- // paper rectangle
- -0x14A3D7, // 6.9306 x 9.8333
- -0x73338,
- 0x01F46667,
- 0x02C98524,
-
- b5LetterBase,
- kDrvrCreatorType,
-
- inch,
- newStylePaperType,
- notDefaultPaperType,
- {}
- };
-
- resource 'ptyp' (kNewPaperTypesID + 5, sysheap) // Nº 10 Envelope
- {
- "Nº 10 Envelope",
-
- // page rectangle
- 0x00000000, // 9.083 x 3.78
- 0x00000000,
- 0x011028F0,
- 0x028DF9B8,
-
- // paper rectangle
- 0xFFF39478, // 9.5 x 4.125
- 0xFFF0FCDC,
- 0x011C9478,
- 0x029CFCDC,
-
- unknownBase,
- kDrvrCreatorType,
-
- inch,
- newStylePaperType,
- notDefaultPaperType,
- {}
- };
-